package com.leapp.sk.sever.personal

import android.content.Context
import com.example.util.ObjectProcessingUtil
import com.leapp.sk.bean.FeedBackDetialEntity
import com.leapp.sk.bean.response.personal.FeedBackDetialResponseEntity
import com.leapp.sk.viewdelegate.personal.FeedBackDetialDelegate

/**
 * 反馈详情逻辑处理类
 * @author  chaohaipeng  on 2018/8/23.
 */
class FeedBackDetialSever {
    private object mHolder {
        val instance = FeedBackDetialSever()
    }
    companion object {
        fun getInstance(): FeedBackDetialSever {
            return mHolder.instance
        }
    }
    /**
     * 绑定数据
     */
    fun binderData(context: Context, viewDelegate: FeedBackDetialDelegate, obj: FeedBackDetialResponseEntity?){
        val personalMineDataEntity: FeedBackDetialEntity = ObjectProcessingUtil.objMandatoryConversionClass(obj?.data, FeedBackDetialEntity::class.java)
        val backImage = personalMineDataEntity.backImage
        if (backImage!=null){
            viewDelegate?.initImageAdapter(context,backImage)
        }
        viewDelegate?.setData(personalMineDataEntity)
    }


}